import request from '@/utils/request'

export function loginByUsername(phone, code, company_id) {
  const data = {
    phone,
    code,
    company_id
  }
  return request({
    url: '/api/backstage/loginWithCode',
    method: 'post',
    data : data
  })
}
// /POST /api/backstage/loginSendCode 后台登录发送验证码
export function sendCode(query) {
  return request({
    url: '/api/backstage/loginSendCode',
    method: 'post',
    data: query
  })
}
// POST /api/backstage/loginWithCode 手机号验证码登录
export function loginWithCode(token) {
  return request({
    url: '/api/backstage/loginWithCode',
    method: 'post',
    data: { token }
  })
}
export function logout(data) {
  return request({
    url: '/api/backstage/logout',
    method: 'post',
    data : data
  })
}
export function backstage_fileUpload(data) {
  return request({
    url: '/api/backstage/fileUpload',
    method: 'post',
    data : data
  })
}
export function backstage_byteUpload(data) {//base64上传
  return request({
    // url: '/api/reception/byteUploads',
    url: '/api/backstage/byteUpload',
    method: 'post',
    data : data
  })
}
export function getUserInfo(token) {
  return request({
    url: '/admin/info',
    method: 'get',
    params: { token }
  })
}

export function backstage_listCompany(data) {
  return request({
    url: '/api/backstage/listCompany',
    method: 'post',
    data: { data }
  })
}